container: Deprecate resize mode
authorBenjamin Otte <otte@redhat.com>
Sat, 5 Oct 2013 12:57:53 +0000 (14:57 +0200)
committerBenjamin Otte <otte@redhat.com>
Sat, 5 Oct 2013 13:09:53 +0000 (15:09 +0200)
Resize modes don't work anymore, both because nobody ever uses them and
because the frame clock changed the way things work quite a bit. So we
don't want to advertise them as a good idea.

https://bugzilla.gnome.org/show_bug.cgi?id=708787

gtk/gtkcontainer.c
gtk/gtkcontainer.h
gtk/gtkplug.c
gtk/gtkstylecontext.c
gtk/gtkwindow.c

index 82fda082a6356d634ffd47a7859c6162c072056f..be375b06edf4e7e492d149254061f5642af30fc8 100644 (file)
@@ -1419,7 +1419,9 @@ gtk_container_set_property (GObject         *object,
       gtk_container_set_border_width (container, g_value_get_uint (value));
       break;
     case PROP_RESIZE_MODE:
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
       gtk_container_set_resize_mode (container, g_value_get_enum (value));
+      G_GNUC_END_IGNORE_DEPRECATIONS;
       break;
     case PROP_CHILD:
       gtk_container_add (container, GTK_WIDGET (g_value_get_object (value)));
@@ -1595,6 +1597,10 @@ _gtk_container_dequeue_resize_handler (GtkContainer *container)
  * The resize mode of a container determines whether a resize request
  * will be passed to the container's parent, queued for later execution
  * or executed immediately.
+ *
+ * Deprecated: 3.12: Resize modes are deprecated. They aren't necessary
+ *     anymore since frame clocks and might introduce obscure bugs if
+ *     used.
  **/
 void
 gtk_container_set_resize_mode (GtkContainer  *container,
@@ -1630,6 +1636,10 @@ gtk_container_set_resize_mode (GtkContainer  *container,
  * gtk_container_set_resize_mode ().
  *
  * Return value: the current resize mode
+ *
+ * Deprecated: 3.12: Resize modes are deprecated. They aren't necessary
+ *     anymore since frame clocks and might introduce obscure bugs if
+ *     used.
  **/
 GtkResizeMode
 gtk_container_get_resize_mode (GtkContainer *container)
@@ -1748,7 +1758,9 @@ gtk_container_queue_resize_handler (GtkContainer *container)
 {
   GtkWidget *widget;
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
   g_return_if_fail (GTK_IS_RESIZE_CONTAINER (container));
+  G_GNUC_END_IGNORE_DEPRECATIONS;
 
   widget = GTK_WIDGET (container);
 
@@ -1793,8 +1805,10 @@ _gtk_container_queue_resize_internal (GtkContainer *container,
       _gtk_widget_set_alloc_needed (widget, TRUE);
       _gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (widget));
 
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
       if (GTK_IS_RESIZE_CONTAINER (widget))
         break;
+      G_GNUC_END_IGNORE_DEPRECATIONS;
 
       widget = gtk_widget_get_parent (widget);
     }
@@ -1879,6 +1893,7 @@ gtk_container_real_check_resize (GtkContainer *container)
   if (requisition.width > allocation.width ||
       requisition.height > allocation.height)
     {
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
       if (GTK_IS_RESIZE_CONTAINER (container))
         {
           gtk_widget_size_allocate (widget, &allocation);
@@ -1886,6 +1901,7 @@ gtk_container_real_check_resize (GtkContainer *container)
         }
       else
         gtk_widget_queue_resize (widget);
+      G_GNUC_END_IGNORE_DEPRECATIONS;
     }
   else
     {
index 4a334df783199335c091a3e94794645dc2c99048..0a1f7b68dc87948ff6ce832bb3fe944aab9c698f 100644 (file)
@@ -119,10 +119,10 @@ GDK_AVAILABLE_IN_ALL
 void    gtk_container_remove            (GtkContainer     *container,
                                          GtkWidget        *widget);
 
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_12
 void    gtk_container_set_resize_mode    (GtkContainer     *container,
                                          GtkResizeMode     resize_mode);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_12
 GtkResizeMode gtk_container_get_resize_mode (GtkContainer     *container);
 
 GDK_AVAILABLE_IN_ALL
index c2fb49304bd97ae2ebf463ac2f2c8064d731f6d9..66917a3db779075595be07fc0a54b1da71547db9 100644 (file)
@@ -313,7 +313,9 @@ gtk_plug_set_is_child (GtkPlug  *plug,
        gtk_widget_unmap (widget);
 
       _gtk_window_set_is_toplevel (GTK_WINDOW (plug), FALSE);
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
       gtk_container_set_resize_mode (GTK_CONTAINER (plug), GTK_RESIZE_PARENT);
+      G_GNUC_END_IGNORE_DEPRECATIONS;
 
       _gtk_widget_propagate_hierarchy_changed (widget, widget);
     }
@@ -328,7 +330,9 @@ gtk_plug_set_is_child (GtkPlug  *plug,
       gtk_window_group_add_window (priv->modality_group, GTK_WINDOW (plug));
 
       _gtk_window_set_is_toplevel (GTK_WINDOW (plug), TRUE);
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
       gtk_container_set_resize_mode (GTK_CONTAINER (plug), GTK_RESIZE_QUEUE);
+      G_GNUC_END_IGNORE_DEPRECATIONS;
 
       _gtk_widget_propagate_hierarchy_changed (GTK_WIDGET (plug), NULL);
     }
index b02f45fd3e63ef3ea4bd294367bea2774a3811d5..9f35f42c82f6dd18f480b1db1e963cf6d4fcf3d2 100644 (file)
@@ -1069,10 +1069,12 @@ gtk_style_context_set_invalid (GtkStyleContext *context,
 
   if (invalid)
     {
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
       if (GTK_IS_RESIZE_CONTAINER (priv->widget))
         _gtk_container_queue_restyle (GTK_CONTAINER (priv->widget));
       else if (priv->parent)
         gtk_style_context_set_invalid (priv->parent, TRUE);
+      G_GNUC_END_IGNORE_DEPRECATIONS;
     }
 }
 
index ba685c0a09634591c22a7b35c23a61a4d5bbe966..bcb23e9a6f803fa3f2ca9a5578f1a08cb4620bcb 100644 (file)
@@ -1287,7 +1287,9 @@ gtk_window_init (GtkWindow *window)
   _gtk_widget_set_is_toplevel (widget, TRUE);
   _gtk_widget_set_anchored (widget, TRUE);
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
   gtk_container_set_resize_mode (GTK_CONTAINER (window), GTK_RESIZE_QUEUE);
+  G_GNUC_END_IGNORE_DEPRECATIONS;
 
   priv->title = NULL;
   priv->wmclass_name = g_strdup (g_get_prgname ());
@@ -5780,7 +5782,9 @@ gtk_window_realize (GtkWidget *widget)
 
   if (gtk_widget_get_parent_window (widget))
     {
+      G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
       gtk_container_set_resize_mode (GTK_CONTAINER (widget), GTK_RESIZE_PARENT);
+      G_GNUC_END_IGNORE_DEPRECATIONS;
 
       attributes.x = allocation.x;
       attributes.y = allocation.y;
@@ -5804,7 +5808,9 @@ gtk_window_realize (GtkWidget *widget)
       return;
     }
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
   gtk_container_set_resize_mode (GTK_CONTAINER (window), GTK_RESIZE_QUEUE);
+  G_GNUC_END_IGNORE_DEPRECATIONS;
 
   /* ensure widget tree is properly size allocated */
   if (allocation.x == -1 &&
@@ -9040,8 +9046,10 @@ gtk_window_move_resize (GtkWindow *window)
 
          gdk_window_process_updates (gdk_window, TRUE);
 
+          G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
          if (gtk_container_get_resize_mode (container) == GTK_RESIZE_QUEUE)
            gtk_widget_queue_draw (widget);
+          G_GNUC_END_IGNORE_DEPRECATIONS;
        }
       else
         {
@@ -9064,11 +9072,13 @@ gtk_window_move_resize (GtkWindow *window)
           * FIXME: we should also dequeue the pending redraws here, since
           * we handle those ourselves upon ->configure_notify_received==TRUE.
           */
+          G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
          if (gtk_container_get_resize_mode (container) == GTK_RESIZE_QUEUE)
            {
              gtk_widget_queue_resize_no_redraw (widget);
              _gtk_container_dequeue_resize_handler (container);
            }
+          G_GNUC_END_IGNORE_DEPRECATIONS;
        }
     }
   else